"Bazel dependencies"

module(
    name = "rules_spring_aot",
    version = "0.1.0",
)

bazel_dep(name = "bazel_skylib", version = "1.8.0")
bazel_dep(name = "package_metadata", version = "0.0.3")
bazel_dep(name = "platforms", version = "1.0.0")

bazel_dep(name = "gazelle", version = "0.44.0", dev_dependency = True, repo_name = "bazel_gazelle")
bazel_dep(name = "bazel_skylib_gazelle_plugin", version = "1.8.0", dev_dependency = True)
bazel_dep(name = "aspect_bazel_lib", version = "2.19.4", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2", dev_dependency = True)

bazel_dep(name = "rules_java", version = "8.13.0")

bazel_dep(name = "rules_graalvm", version = "0.11.1", dev_dependency = True)

gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm", dev_dependency = True)

# https://github.com/sgammon/rules_graalvm/issues/401
git_override(
    module_name = "rules_graalvm",
    branch = "main",
    remote = "https://github.com/sgammon/rules_graalvm.git",
)

gvm.graalvm(
    name = "graalvm",
    distribution = "oracle",
    java_version = "21",
    version = "21.0.2",
)
use_repo(gvm, "graalvm")

register_toolchains(
    "@graalvm//:jvm",
    dev_dependency = True,
)

register_toolchains(
    "@graalvm//:sdk",
    dev_dependency = True,
)

register_toolchains(
    "@graalvm//:toolchain",
    dev_dependency = True,
)

register_toolchains(
    "@graalvm//:toolchain_gvm",
    dev_dependency = True,
)

register_toolchains(
    "@graalvm//:bootstrap_runtime_toolchain",
    dev_dependency = True,
)

bazel_dep(name = "rules_jvm_external", version = "6.7", dev_dependency = True)

maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven", dev_dependency = True)
maven.install(
    artifacts = [
        "org.springframework.boot:spring-boot-starter-web",
        "org.springframework.shell:spring-shell-starter",
    ],
    boms = [
        "org.springframework.boot:spring-boot-dependencies:3.4.7",
        "org.springframework.shell:spring-shell-dependencies:3.4.0",
    ],
    fail_if_repin_required = True,
    fetch_sources = True,
    lock_file = "//:maven_install.json",
    repositories = [
        "https://repo1.maven.org/maven2",
    ],
    resolver = "maven",
)
use_repo(maven, "maven")
